#! /bin/bash

INSTALL_ROOT="/usr/local/traker"
RC_LOCAL="/etc/rc.d/rc.local"

echo 'copying files...'
! mkdir -p $INSTALL_ROOT && exit 1
! cp traker $INSTALL_ROOT/traker -f && exit 1
! cp conf.cfg $INSTALL_ROOT/conf.cfg -f && exit 1

echo 'create symbol link...'
! ln -s $INSTALL_ROOT/traker /usr/bin/traker -f && exit 1

echo 'accessing /etc/rc.d/rc.local...'
if ! grep '^traker$' $RC_LOCAL > /dev/null 
then
	! echo traker >> $RC_LOCAL && exit 1
fi

echo 'installation complete'

